{extend name="iframe" /}

{block name="body"}
<style>
    .layui-form-select{
        z-index: 1000;
    }
</style>
<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
    <form action="{:request()->url()}" method="post" class="xn_ajax" data-type="open">
        <div class="layui-form-item">
            <label class="layui-form-label">UID</label>
            <div class="layui-input-block">
                <input type="text" name="uid" placeholder="" autocomplete="off" class="layui-input" value="{$data.uid}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">机场名称</label>
            <div class="layui-input-block">
                <input type="text" name="name" placeholder="" autocomplete="off" class="layui-input" value="{$data.name}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">坐标</label>
            <div class="layui-input-block">
                <input type="text" name="location" placeholder="" autocomplete="off" class="layui-input" value="{$data.location}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">入口坐标</label>
            <div class="layui-input-block">
                <input type="text" name="entr_location" placeholder="" autocomplete="off" class="layui-input" value="{$data.entr_location}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">省份</label>
            <div class="layui-input-block">
                <input type="text" name="pname" placeholder="" autocomplete="off" class="layui-input" value="{$data.pname}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">城市</label>
            <div class="layui-input-block">
                <input type="text" name="cityname" placeholder="" autocomplete="off" class="layui-input" value="{$data.cityname}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">地区</label>
            <div class="layui-input-block">
                <input type="text" name="adname" placeholder="" autocomplete="off" class="layui-input" value="{$data.adname}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">地址</label>
            <div class="layui-input-block">
                <input type="text" name="address" placeholder="" autocomplete="off" class="layui-input" value="{$data.address}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">类型</label>
            <div class="layui-input-block">
                <input type="text" name="type" placeholder="" autocomplete="off" class="layui-input" value="{$data.type}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">电话</label>
            <div class="layui-input-block">
                <input type="text" name="tel" placeholder="" autocomplete="off" class="layui-input" value="{$data.tel}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">图片数据</label>
            <div class="layui-input-block">
                <textarea name="photos" class="layui-textarea">{$data.photos}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" lay-submit class="layui-btn">保存</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="js"}
<script>
    var form = layui.form;
    form.on('select(parent_typeid)', function(res) { 
        $("#typeid").empty();
        if(res.value != 0){
            $.get("{:url('admin/DataType/getSonType')}?pid="+res.value,function(result){
                if(result.status){
                    $("#typeid").append(new Option('请选择',0));
                    $.each(result.data,function(index,item){
                        $("#typeid").append(new Option(item.title,item.id));
                    });
                    form.render("select");
                }
            });
        }else{
            $("#typeid").append(new Option('请选择',0));
            form.render("select");
        }
    })
</script>
{/block}
